import request from '@/utils/request'
import { baseURL } from '@/config'

export function getList(data) {
  return request({
    url: '/admin/employee/getList',
    method: 'post',
    data,
  })
}

export function getById(params) {
  return request({
    url: '/admin/employee/getEmployeeById',
    method: 'get',
    params,
  })
}

export function getExcelStatus(params) {
  return request({
    url: '/admin/employee/getExcelStatus',
    method: 'get',
    params,
  })
}
export function delExcelExecute(params) {
  return request({
    url: '/admin/employee/delExcelExecute',
    method: 'get',
    params,
  })
}

export function getAllList(params) {
  return request({
    url: '/admin/employee/getAllList',
    method: 'get',
    params,
  })
}

export function getLevelList(data) {
  return request({
    url: '/admin/employee/getLevelList',
    method: 'post',
    data,
  })
}

export function doEdit(data) {
  return request({
    url: '/admin/employee/doEdit',
    method: 'post',
    data,
  })
}
export function doEditArea(data) {
  return request({
    url: '/admin/employee/doEditArea',
    method: 'post',
    data,
  })
}

export function doAddAll(data) {
  return request({
    url: '/admin/employee/doAddAll',
    method: 'post',
    data,
  })
}

export function analysisIdCard(data) {
  return request({
    url: '/admin/employee/analysisIdCard',
    method: 'post',
    data,
  })
}

export function getByIdCard(data) {
  return request({
    url: '/admin/employee/getByIdCard',
    method: 'post',
    data,
  })
}

export function doRealname(data) {
  return request({
    url: '/admin/employee/doRealName',
    method: 'post',
    data,
  })
}

export function exportTemplate() {
  window.location.href = baseURL + 'admin/employee/exportTemplate'
}
export function downloadPositionNoGood() {
  window.location.href = baseURL + 'admin/employee/downloadPositionNoGood'
}

export function doImport(data) {
  return request({
    url: '/admin/employee/doImport',
    method: 'post',
    data,
  })
}

export function doImportPositionNoGood(data) {
  return request({
    url: '/admin/employee/doImportPositionNoGood',
    method: 'post',
    data,
  })
}

export function doDelete(data) {
  return request({
    url: '/admin/employee/doDelete',
    method: 'post',
    data,
  })
}

export function doDeleteArea(data) {
  return request({
    url: '/admin/employee/doDeleteArea',
    method: 'post',
    data,
  })
}

export function exportError(token) {
  window.location.href = baseURL + 'admin/employee/exportError?token=' + token
}

export function doBlack(data) {
  return request({
    url: '/admin/employee/doBlack',
    method: 'post',
    data,
  })
}

export function doInjury(data) {
  return request({
    url: '/admin/employee/doInjury',
    method: 'post',
    data,
  })
}
